#!/usr/bin/env php
<?php
$yuicompressor = '~/Projects/yuicompressor-2.4.6/build/yuicompressor-2.4.6.jar';
$theme_path = dirname(__FILE__) . '/../';
$source_file = $theme_path . 'style.dev.css';
$temp_file = $theme_path . 'style.css.tmp';
$dst_file = $theme_path . 'style.css';

$comments = <<<COMMENTS
/*
Theme Name: GoogleCode 2011
Theme URI: http://sexywp.com/googlecode2011
Author: Charles Tang
Author URI: http://sexywp.com/
Description: The new implementation of google code theme. This theme's code is based hybrid 0.9.
Version: 1.0
Tags: simple
*/

COMMENTS;
echo $source_file , PHP_EOL;
echo $dst_file , PHP_EOL;
$cmd = "java -jar $yuicompressor -o $temp_file --type css --line-break 2000 $source_file";
system($cmd);
$fd = fopen($dst_file,'w');
$css = file_get_contents($temp_file);
fwrite($fd, $comments);
fwrite($fd, $css);
fclose($fd);
echo 'Success!', PHP_EOL;
unlink($temp_file);
